//
//  BaseIconView.m
//  PostDelivery
//
//  Created by wmz on 2020/7/6.
//  Copyright © 2020 wmz. All rights reserved.
//

#import "BaseIconView.h"

@implementation BaseIconView

- (void)hd_setupViews{
    [self addSubview:self.icon];
    [self addSubview:self.myLa];
}

- (void)updateConstraints{
    [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(PostT);
        make.centerX.mas_equalTo(0);
        make.height.equalTo(self).multipliedBy(0.7);
    }];
    [self.myLa mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(0);
        make.top.equalTo(self.icon.mas_bottom).offset(2);
    }];
    [super updateConstraints];
}
       
- (UIImageView *)icon{
    if (!_icon) {
        _icon = [UIImageView new];
        _icon.contentMode = UIViewContentModeScaleAspectFit;
        _icon.layer.masksToBounds = YES;
    }
    return _icon;
}
- (UILabel *)myLa{
    if (!_myLa) {
        _myLa = [UILabel new];
        _myLa.textColor = wColor_3;
        _myLa.textAlignment = NSTextAlignmentCenter;
        _myLa.font = [UIFont systemFontOfSize:wFontSize_13];
    }
    return _myLa;
}
@end
